package com.blockchain.console.servlets.content.cjwt;

import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.blockchain.console.service.content.QuestionManage;
import com.blockchain.framework.service.ServiceSession;
import com.blockchain.util.parser.IntegerParser;

public class UpdateQuestionPxz extends AbstractQuestionServlet{

	private static final long serialVersionUID = 1L;

	@Override
	protected void processGet(HttpServletRequest request,
			HttpServletResponse response, ServiceSession serviceSession)
			throws Throwable {
		processPost(request, response, serviceSession);
	}
	
	@Override
	protected void processPost(HttpServletRequest request,
			HttpServletResponse response, ServiceSession serviceSession)
			throws Throwable {
		QuestionManage questionManage=serviceSession.getService(QuestionManage.class);
		int id = IntegerParser.parse(request.getParameter("id"));
		int pxz = IntegerParser.parse(request.getParameter("pxz"));
		questionManage.updateQuestionPxz(id,pxz);
		PrintWriter out=response.getWriter();
		out.write(1);
		out.flush();
	}
}
